
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <iostream>
#include <cstring>
#include <string>
#include "stdio.h"
using namespace std;

int main()
{
    char str[1000];

    while (gets(str) != NULL)
    {
        int cnt_e = 0, cnt_s = 0, cnt_n = 0, cnt_o = 0;
        for (int i = 0; i < strlen(str); i++)
        {
            if (str[i] == ' ')
                cnt_s++;
            else if ((str[i] >= 'a' && str[i] <= 'z') ||
                     (str[i] >= 'A' && str[i] <= 'Z'))
            {
                cnt_e++;
            }
            else if (str[i] <= '9' && str[i] >= '0')
            {
                cnt_n++;
            }
            else
                cnt_o++;
        }
        cout.width(4);
        cout << cnt_e << endl;
        cout.width(4);
        cout << cnt_s << endl;
        cout.width(4);
        cout << cnt_n << endl;
        cout.width(4);
        cout << cnt_o << endl;
    }
    return 0;
}